#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_DH_STRIP_ARGS := --dbg-package=mc-dbg
DEB_CONFIGURE_LIBEXECDIR := /usr/lib
DEB_CONFIGURE_EXTRA_FLAGS := --with-x --with-screen=slang --enable-aspell --disable-rpath --disable-static
AWK := awk

# If DEB_BUILD_OPTIONS=parallel=n, build in n parallel processes
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	MAKEFLAGS += -j$(NUMJOBS)
endif

DEB_FIXPERMS_EXCLUDE := /usr/lib/mc/cons.saver

#makebuilddir/mc::
#	dh_autoreconf

binary-post-install/mc::
	chmod 644 ./debian/mc/usr/share/mc/bin/mc*

	chgrp tty ./debian/mc/usr/lib/mc/cons.saver || true
	chmod g+s ./debian/mc/usr/lib/mc/cons.saver || true

	chmod 644 ./debian/mc/usr/lib/mc/fish/*

#cleanbuilddir/mc::
#	dh_autoreconf_clean
